package de.tudarmstadt.ukp.wikisniffer.userstudy.util;

public class Answer {
	
	private String answer;
	private Question question;
	
	public boolean isVpCode(){
		return question == null;
	}
	
	public String toString(){
		if(answer == null) return "no answer defined!";
		
		
		if(answer.equals(question.getCorrectAnswer())){
			answer += "\tcorrect";
		}
		else{
			answer += "\twrong";
		}
		
		answer = question.getId() + "\t" + answer;
		
		return answer;
	}
	
	public void setAnswer(String answer, Question question){
		this.answer = answer;
		this.question = question;
	}
	
	public String getAnswer(){
		return answer;
	}

}
